package model;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @Author quan
 * @Description User的实体类
 * @Date 2023/6/30 16:17
 */
public class User {
    //三个属性和数据库表中的字段要对应
    private Long id;
    private String username;
    @JsonIgnore//不参与json序列化
    private String password;

    private boolean isAuthor;

    //无参构造
    public User(){}
    //提供相应的get和set方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean isAuthor() {
        return isAuthor;
    }

    public void setAuthor(boolean author) {
        isAuthor = author;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", isAuthor=" + isAuthor +
                '}';
    }
}
